package com.example.springdemo0921.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringApplication {

    public static void main(String[] args) {
//        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
//        Object person = classPathXmlApplicationContext.getBean("person");
//        System.out.println("person: "+person.toString());
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(JavaBean.class);
        Object productRateConfig = annotationConfigApplicationContext.getBean("productRateConfig2");
        System.out.println("productRateConfig: "+productRateConfig.toString());
        Object Person = annotationConfigApplicationContext.getBean(com.example.springdemo0921.Person.class);
        System.out.println("Person: "+Person.toString());
//
    }

}
